package com.zxy.ziems.server.energy.pojo.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class EnergyPriceDTO {

    @NotBlank(message = "ID不可为空", groups = {EnergyPriceDTO.Modify.class, EnergyPriceDTO.Delete.class})
    private String id;

    @NotBlank(message = "能源类型不可为空", groups = {EnergyPriceDTO.Add.class, EnergyPriceDTO.Modify.class})
    private String dataTypeId; // 属性ID

    @NotBlank(message = "名称不可为空", groups = {EnergyPriceDTO.Add.class, EnergyPriceDTO.Modify.class})
    private String name; // 名称

    private String description; // 描述

    @NotNull(message = "单一价格不可为空", groups = {EnergyPriceDTO.Add.class, EnergyPriceDTO.Modify.class})
    private Boolean singleStatus; // 是否单一

    private BigDecimal singlePrice; // 单一价格

    @NotNull(message = "开始时间不可为空", groups = {EnergyPriceDTO.Add.class, EnergyPriceDTO.Modify.class})
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startDate; // 开始时间

    @NotNull(message = "结束时间不可为空", groups = {EnergyPriceDTO.Add.class, EnergyPriceDTO.Modify.class})
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endDate; // 结束时间

    @NotNull(message = "是否尖峰平谷分段不可为空", groups = EnergyPriceDTO.Add.class)
    private Boolean peakStatus; // 是否尖峰平谷分段

    public interface Add { }

    public interface Modify { }

    public interface Delete { }
}
